﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ConsumableEdit.aspx.cs"
    Inherits="WebUI.LabManage.ConsumableEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" runat="server" />
    <ext:Panel ID="addPanel" runat="server" ShowHeader="false" ShowBorder="false" Hidden="true">
        <Items>
            <ext:Form runat="server" ID="addForm" ShowHeader="false" ShowBorder="false" EnableBackgroundColor="true"
                BodyPadding="5px">
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:TextBox runat="server" ID="tb_add_name" Label="易耗品名" Required="true" ShowRedStar="true">
                            </ext:TextBox>
                            <ext:DropDownList runat="server" ID="dl_add_location" Label="所属地点" Required="true" ShowRedStar="true">
                            </ext:DropDownList>
                        </Items>
                    </ext:FormRow>
                </Rows>
                <Rows>
                    <ext:FormRow>
                        <Items>
                           <ext:TextBox runat="server" ID="tb_add_normal" Label="正常数" Required="true" ShowRedStar="true"></ext:TextBox>
                           <ext:TextBox runat="server" ID="tb_add_bad" Label="故障数" Required="true" ShowRedStar="true"></ext:TextBox>
                           <ext:TextBox runat="server" ID="tb_add_stock" Label="库存数" Required="true" ShowRedStar="true"></ext:TextBox>
                        </Items>
                    </ext:FormRow>
                </Rows>
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:TextBox runat="server" ID="tb_add_remarks" Label="备注说明">
                            </ext:TextBox>
                        </Items>
                    </ext:FormRow>
                </Rows>
            </ext:Form>
        </Items>
        <Toolbars>
            <ext:Toolbar runat="server" Position="Bottom">
                <Items>
                    <ext:ToolbarFill ID="ToolbarFill1" runat="server">
                    </ext:ToolbarFill>
                    <ext:Button runat="server" ID="bnSave" Icon="Add" Text="保存" Type="Submit" ValidateForms="addForm" OnClick="bnAdd_OnClick">
                    </ext:Button>
                    <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
                    </ext:ToolbarSeparator>
                    <ext:Button runat="server" ID="bn_close2" Icon="Decline" Text="关闭">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </Toolbars>
    </ext:Panel>
    <ext:Panel ID="editPanel" runat="server" ShowHeader="false" ShowBorder="false" Hidden="true">
        <Items>
            <ext:Form runat="server" ID="editForm" ShowHeader="false" ShowBorder="false" EnableBackgroundColor="true"
                BodyPadding="5px">
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:TextBox runat="server" ID="tb_edit_name" Label="易耗品名">
                            </ext:TextBox>
                            <ext:DropDownList runat="server" ID="dl_edit_location" Label="所属地点">
                            </ext:DropDownList>
                        </Items>
                    </ext:FormRow>
                </Rows>
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:TextBox runat="server" ID="tb_edit_remarks" Label="备注说明">
                            </ext:TextBox>
                        </Items>
                    </ext:FormRow>
                </Rows>
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:HiddenField runat="server" ID="hf_edit_normal">
                            </ext:HiddenField>
                            <ext:HiddenField runat="server" ID="hf_edit_bad">
                            </ext:HiddenField>
                            <ext:HiddenField runat="server" ID="hf_edit_stock">
                            </ext:HiddenField>
                        </Items>
                    </ext:FormRow>
                </Rows>
            </ext:Form>
        </Items>
        <Toolbars>
            <ext:Toolbar runat="server" Position="Bottom">
                <Items>
                    <ext:ToolbarFill runat="server">
                    </ext:ToolbarFill>
                    <ext:Button runat="server" ID="bn_edit" Icon="Add" Text="保存编辑" OnClick="bnEdit_OnClick">
                    </ext:Button>
                    <ext:ToolbarSeparator runat="server">
                    </ext:ToolbarSeparator>
                    <ext:Button runat="server" ID="bn_close" Icon="Decline" Text="关闭">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </Toolbars>
    </ext:Panel>
    <ext:Panel ID="viewPanel" runat="server" ShowHeader="false" ShowBorder="false" Hidden="true">
        <Items>
            <ext:Form runat="server" ID="viewForm" ShowHeader="true" ShowBorder="false" EnableBackgroundColor="true" Icon="Package"
                Title="易耗品信息" BodyPadding="5px">
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:Label runat="server" ID="lb_view_name" Label="易耗品名">
                            </ext:Label>
                            <ext:Label runat="server" ID="lb_view_location" Label="所属地点">
                            </ext:Label>
                        </Items>
                    </ext:FormRow>
                </Rows>
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:Label runat="server" ID="lb_view_remarks" Label="备注说明">
                            </ext:Label>
                        </Items>
                    </ext:FormRow>
                </Rows>
                <Rows>
                    <ext:FormRow>
                        <Items>
                            <ext:Label runat="server" ID="lb_view_normal" Label="正常数量">
                            </ext:Label>
                            <ext:Label runat="server" ID="lb_view_bad" Label="故障数量">
                            </ext:Label>
                            <ext:Label runat="server" ID="lb_view_stock" Label="库存数量">
                            </ext:Label>
                        </Items>
                    </ext:FormRow>
                </Rows>
                <Rows>
                <ext:FormRow>
                <Items>
                <ext:TextBox runat="server" ID="tb_update_normal" Label="新正常数" Required="true"></ext:TextBox>
                <ext:TextBox runat="server" ID="tb_update_bad" Label="新故障数" Required="true" OnTextChanged="updateStock_OnTextChanged" AutoPostBack="true"></ext:TextBox>
                <ext:TextBox runat="server" ID="tb_update_stock" Label="新库存数" Required="true"></ext:TextBox>
                </Items>
                </ext:FormRow>
                </Rows>
                <Rows>
                <ext:FormRow>
                <Items>
                <ext:DatePicker runat="server" ID="dp_update_date" Label="更新日期" Width="170px" Required="true"></ext:DatePicker>
                <ext:HiddenField runat="server" ID="hf_view_location" ></ext:HiddenField>
                </Items>
                </ext:FormRow>
                </Rows>
                <Toolbars>
                <ext:Toolbar runat="server" Position="Bottom" >
                <Items>
                <ext:ToolbarFill runat="server" ></ext:ToolbarFill>
                <ext:Button runat="server" ID="btn_Update" Icon="DateNext" Text="更新" OnClick="bnUpdate_OnClick" Type="Submit" ValidateForms="viewForm"></ext:Button>
                </Items>
                </ext:Toolbar>
                </Toolbars>
            </ext:Form>
            <ext:Grid runat="server" ID="GridRecord" ShowHeader="true" ShowBorder="false" Title="历史库存记录" Height="310px" 
                PageSize="10" EnableRowNumber="true" AllowPaging="true" Icon="Disk" >
                <Columns>
                    <ext:BoundField ColumnID="date" DataField="date" DataFormatString="{0:yyyy-MM-dd}" HeaderText="记录日期" Width="170px" />
                    <ext:BoundField DataField="normal" HeaderText="正常数量" />
                    <ext:BoundField DataField="bad" HeaderText="故障数量" />
                    <ext:BoundField DataField="stock" HeaderText="库存数量" />
                </Columns>
            </ext:Grid>
        </Items>
        <Toolbars>
            <ext:Toolbar runat="server" Position="Bottom">
                <Items>
                    <ext:ToolbarFill runat="server">
                    </ext:ToolbarFill>
                    <ext:Button runat="server" ID="btn_viewClose" Text="关闭" Icon="Decline">
                    </ext:Button>
                </Items>
            </ext:Toolbar>
        </Toolbars>
    </ext:Panel>
    <ext:Panel ID="updatePanel" runat="server" ShowHeader="false" ShowBorder="false"
        Hidden="true">
    </ext:Panel>
    </form>
</body>
</html>
